package org.dizem.groupon.action;

import com.opensymphony.xwork2.ActionSupport;
import org.dizem.groupon.service.ImageService;

import java.io.InputStream;

/**
 * User: dizem@126.com
 * Time: 11-6-27 上午12:54
 */
public class GetImageAction extends ActionSupport {
	private int id;
	private ImageService imageService;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public ImageService getImageService() {
		return imageService;
	}

	public void setImageService(ImageService imageService) {
		this.imageService = imageService;
	}

	public InputStream getImage() throws Exception {
		return imageService.getById(id).getImage().getBinaryStream();
	}
}
